home *** CD-ROM | disk | FTP | other *** search
- =====EASY DISK FORMATTING=====
- =====Including EASY EXIT and DISK SPACE CHECK=====
-
- When you have a lot of disks to format, or if you
- just want to pre-format a whole box in a hurry, or
- if you want to make it easy for your secretary to do it,
- try this (you must be using DOS 2):
-
- 1. Copy the following files to your RAMDISK:
- (You can write a batch file to do this, to make it easier).
-
- FORMAT.COM
- FMT.BAT
- INPUT
- CHK.COM
-
- 2. Make the drive that you copied these to the default, put 2 floppies to
- be formatted in drives A and B, and type
- FMT
-
- 3. As each drive finishes, replace that disk with a new one.
- When done, press the Backspace key (you will then exit to DOS as
- soon as the present disk is completed). Any key will work, but
- keys that print on the screen will show that key on the DOS command
- line when the batch file is done, which can be inconvenient.
- If, after formatting, a disk has any bad sectors, FMT will return you
- to DOS and print a "B" on the screen. You can then shake the disk,
- blow on it, whatever, and try it again - just type FMT when ready.
-
- -----------------------------------------------------------------
- -----------------------------------------------------------------
- How to make up the files:
- [To avoid typing these in again, just extract them with
- your text editor].
- -----------------------------------------------------------------
-
- FMT.BAT:
-
- ECHO OFF
- CLS
- ECHO FORMATTING DRIVE B:...
- FORMAT B: <INPUT >NUL
- CHK B
- IF ERRORLEVEL 1 GOTO EXIT
- CLS
- ECHO Formatting drive A:...
- FORMAT A: <INPUT >NUL
- CHK A
- IF ERRORLEVEL 1 GOTO EXIT
- fmt
- :EXIT
- ------------------------------------
-
- INPUT:
-
- <Carriage return>
- N
- ------------------------------------
- CHK.COM:
-
- First make up the ascii file BRK as follows:
- (the space just before RCX is a carriage return - important)
-
- A100
- MOV SI,0082
- MOV DL,[SI]
- OR DL,20
- SUB DL,60
- MOV AH,36
- INT 21
- MUL BX
- CMP AX,02C4
- MOV AX,0E42
- JNZ 0121
- MOV AH,0B
- INT 21
- MOV AH,4C
- INT 21
- INT 10
- JMP 011D
-
- RCX
- 80
- W
- Q
-
- The Q is the last item in BRK...
- Now type DEBUG CHK.COM <BRK
-
- When you return to DOS you will discover that there is now a
- new file called CHK.COM on your disk.
- ---------------------------------------------------------------------
-
- Credits and Other Interesting Stuff --Jan. 1, 1985--
-
- Original FMT.BAT is from Stephen Goodman's BBS file and ESP Software,
- and was published as a letter in The Programmer's Journal, Vol. 2, #6.
- CHK.COM and ERRORLEVEL check by Jack Wright, CIS 74176,3256.
- Thanks to Jim Gainsley for suggesting the disk space check.
-
- Due to Ctrl-Break disabling by FORMAT, Ctrl-Break would not allow you to
- exit from the original batch file, unless you held it down continuously at
- the end of the formatting. And if you did this, you would stop the FORMAT
- program just as it was about to put the FAT, boot record, and Directory on
- the disk. If you've ever wondered what the DOS message "File creation error"
- meant, that was the cause - DOS was trying to find the directory and FAT on
- a disk that didn't have them.
- The addition of CHK and the ERRORLEVEL check allows you to exit by
- pressing any key at any time (though it will not have an effect until
- the present disk has completed formatting). CHK also checks to see
- if there were any bad sectors on the formatted disk, and prints a "B"
- (for Bad) and exits to DOS if there were, allowing you to weed out the
- bad disks, check them for dirt, etc., and try them again. CHK requires
- one argument - the drive letter of the drive to be checked. No colon needed.
-
- If you are formatting disks differently than the standard 9 sector,
- 2-sided format, you will need to change the 02C4 value in the
- CMP statement in CHK.COM above to reflect the free space in the
- format you're using. It should equal the no. of sectors of free
- space in hex.
-
- Remember that the FORMAT command can be dangerous. That's why formatting
- was not originally designed to be this easy. Keep your fingers
- away from the "C" key when typing in the FMT format line, and be careful
- what you feed the PC when FMT is running. You might want to delete
- FMT.BAT from your RAMDISK when you are done, in case you are prone to
- typing things in by accident. Don't la